<template>
	<view class="">
		<view class="tab-bar">
			<view class="tab-bar-item" :class="{active: tabCur == 1}" @click="onTabChange(1)">
				全部协议
			</view>
			<view class="tab-bar-item" :class="{active: tabCur == 2}" @click="onTabChange(2)">
				运输协议
			</view>
			<view class="tab-bar-item" :class="{active: tabCur == 3}" @click="onTabChange(3)">
				委托收款协议
			</view>
		</view>
		<view class="tab-bar-height"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabCur: 1
			}
		},
		methods: {
			onTabChange(cur) {
				this.tabCur = cur;
				this.$emit("change", cur)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.tab-bar {
		display: flex;
		align-items: center;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 99;
		.tab-bar-item {
			flex: 1;
			display: flex;
			justify-content: center;
			align-items: center;
			background-color: #fff;
			color: #999;
			padding: 20rpx 0;
			border: 2rpx solid #999;
			&.active {
				background-color: #FB8536;
				color: #fff;
				border: 2rpx solid #FB8536;
			}
		}
	}
	.tab-bar-height {
		height: 80rpx;
	}
</style>